home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ARASAN_S.ZIP / SCORING.H < prev    next >
C/C++ Source or Header  |  1994-05-08  |  2KB  |  63 lines

  1. // Copyright 1992 by Jon Dart.  All Rights Reserved.
  2.  
  3. #ifndef _SCORING_H
  4. #define _SCORING_H
  5.  
  6. #include "board.h"
  7.  
  8. class Scoring
  9. {
  10.     // This class does static evaluation of chess positions.
  11.  
  12.     public:
  13.         
  14.     struct Scores
  15.     {
  16.        int center;
  17.        int development;
  18.        int castling;
  19.        int pawn_structure;
  20.        int king_safety;
  21.        int threats;
  22.        int endgame;
  23.     };
  24.         
  25.     static int evalu8( const Board &board );
  26.     // evaluates "board" from the perspective of the side to move.
  27.         
  28.     static int positional_score( const Board &board );
  29.     // returns a positional score
  30.         
  31.     static int positional_score( const Board &board, Scores &scores,
  32.                      Scores &opp_scores);
  33.     // returns a positional score, with a breakdown of the components.
  34.     // "scores" are the scores for the side to move; "opp_scores"
  35.     // for the opposing side.
  36.         
  37.     static int material_score( const Board &board );
  38.     // returns a material score
  39.         
  40.     static int threat_score( const Board &board, const ColorType side );
  41.     // returns a score indicating severity of threats against the
  42.     // side to move.
  43.  
  44.     static Boolean check_en_prise( const Board &board, const Square sq,
  45.         const Piece p);
  46.     // return "True" if a piece p is unsafe on square "sq".
  47.     
  48.     static Boolean pawn_threats;
  49.     // set by calls to positional_score or evalu8; true if
  50.     // any pieces threatened by pawns.
  51.         
  52.     static int en_prise;
  53.     // set by calls to positional_score or evalu8; count of
  54.     // apparently en prise pieces
  55.         
  56.     static int trapped;
  57.     // set by calls to positional_score or evalu8; true if
  58.     // any piece appears trapped.
  59.  
  60. };
  61.  
  62. #endif
  63.